Computer architecture capable of execution of general purpose multiple instructions

ABSTRACT

A system for issuing a family of instructions during a single clock includes a decoder for decoding the family of instructions and logic, responsive to the decode result, for determining whether resource conflicts would occur if the family were issued during one clock. If no resource conflicts occur, an execution unit executes the family regardless of whether dependencies among the instructions in the family exist.

This application is a continuation of and claims the benefit of U.S.Ser. No. 08/959,643, filed Oct. 28, 1997 now U.S. Pat. No. 5,918,032,which is a continuation of U.S. Ser. No. 08/710,620, filed Sep. 20,1996, now U.S. Pat. No. 5,752,064, which is a continuation of U.S. Ser.No. 08/483,661, filed Jun. 7, 1995, now U.S. Pat. No. 5,628,024, whichis a divisional of U.S. Ser. No. 08/300,815, filed Sep. 2, 1994 nowabandoned, which is a continuation of U.S. Ser. No. 07/890,299, filedMay 27, 1992, now U.S. Pat. No. 5,390,355, which is a continuation ofU.S. Ser. No. 07/356,170, filed May 24, 1989 now abandoned, thedisclosures of which are incorporated by reference.

BACKGROUND OF THE INVENTION

1. Field of the Invention

The present invention relates generally to digital processors and, moreparticularly, to the instruction issuing and execution units of adigital processor.

2. Description of the Relevant Art

A primary goal in the design of digital processors is to increase thethroughput, i.e., the number of instructions processed per unit time, ofthe processor. One approach has been to improve the hardware design ofthe processor to reduce the machine cycle time. Another approach hasbeen to develop architectures and instruction sets designed to processone instruction per machine cycle. Both of these approaches are limitedto a theoretical maximum throughput of one instruction per machine cycledue to basic policy of sequentially issuing at most one instruction percycle.

Systems for issuing more than one instruction per cycle are described ina paper by Ditzel et al. entitled "The Hardware Architecture of theCRISP Microprocessor". 1098 ACM 0084-7495 87, pp. 309-319 and in a paperby Acosta et al. entitled "An instruction issuing Approach to EnhancingPerformance in Multiple Functional Unit Processors", IEEE Transactionson Computers, Vol. C-35, No. 9, September 86, pp. 815-828.

One limitation on concurrent issuing of instructions is that theinstructions must not require the use of the same functional unit of theprocessor during the same machine cycle. This limitation is related tothe resources included in the processor architecture and can be somewhatobviated by providing additional copies of heavily used functionalunits.

The paper by Acosta et al. presents an approach to concurrently issuinginstructions to take advantage of the existence of multiple functionalunits. Further, the CRISP architecture, described in theabove-referenced paper, allows the execution of a branch instructionconcurrently with another instruction. Additionally, mainframes haveallowed concurrent dispatching of integer and floating pointinstructions to different functional units.

However, all of these systems require that the instructions issuedconcurrently not be dependent on each other. Types of dependencies willbe discussed fully below, but a fundamental dependency between a pair ofinstructions is that the second instruction in the pair processes dataresulting from the execution of the first instruction in the pair.Accordingly, the first instruction must be processed prior to thesecond.

Thus, these existing processors may concurrently issue and execute veryfew combinations of instructions. A branch instruction is a special casewhere no memory reference is required and requires only that a newaddress be calculated. Similarly, floating point and integerinstructions require only ALU resources and no memory reference. Thus,data dependencies between the instructions do not exist.

In view of the above limitations, the type of instructions that may beconcurrently issued in these systems is extremely limited and, althoughin certain limited situations two instructions may be issued in oneclock, the average throughput cannot significantly exceed one clock perinstruction.

SUMMARY OF THE INVENTION

In the present invention, a family of instructions is a set ofsequential instructions in a program that may be issued concurrently inone clock. The number of types of instructions that may be included in afamily is greater than allowed in prior art processors.

In the present invention, a family of instructions that includes, forinstance, instructions of the ALU and memory reference type may beissued during a single clock. A special pipeline includes resources thatfacilitate the acceptance and processing of the issued family. Thus, theinvention provides for an instruction processing throughput of greaterthan one instruction per clock.

According to one aspect of the invention, a family of instructions isfetched and decoded. The decode result for each instruction includesstatus information indicating which resources are required to executethe instruction. The family of instructions is issued in one clock ifthe status information indicates that no resource conflicts will occurduring execution.

According to a further aspect of the invention, an execution unitexecutes a family of instructions having data dependencies by providingresulting data of a first instruction required as an operand of a secondinstruction prior to writing the resulting data to a register.

According to a still further aspect of the invention, a subset of theinstructions of a selected instruction set are designated as candidatesfor concurrent execution. The status information in the decode resultsof each instruction in the family indicates whether the instruction is acandidate for concurrent execution. If the status information indicatesthat all the instructions in the family are candidates and that noresource conflicts will occur then the family is executed concurrently.

According to a further aspect of the invention, a unique exceptionhandling procedure allows exception procedures developed for singleinstructions to be utilized thus simplifying the system. The systemtests for the presence of an exception during the execution of a family.If an exception is detected then the data write associated with thefamily is inhibited to preserve the macrostate of the system. Theinstructions in the family are then issued singly so that the existingexception handling procedure may be utilized.

According to another aspect of the invention, a branch recoverymechanism for recovering from a branch misprediction tests for amisprediction by comparing the branch prediction bit and the branchcondition bit. In the event of a misprediction, the mechanism differsdepending on position of the branch instruction within the family. Ifthe branch instruction is the last instruction in the family, then thepipeline is flushed and the correct next instruction is fetched into thepipeline. If the branch instruction is not the last instruction in thefamily, then the data writes associated with all instructions in thefamily following the branch must be inhibited, then the pipeline isflushed and the correct next instruction is fetched into the pipeline.

Other features and advantages of the invention will-become apparent inview of the figures and following detailed description.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 is a high-level block diagram of the invention;

FIG. 2 is a schematic diagram illustrating a specific example ofsequential and concurrent execution of a first pair of instructions;

FIG. 3 is a schematic diagram illustrating a specific example ofsequential and concurrent execution of a second pair of instructions;

FIG. 4 is a block diagram of a prior art three-stage pipeline;

FIG. 5 is a schematic diagram of a six-stage pipeline utilized in anembodiment of the invention;

FIGS. 6A and 6B are a schematic diagram of a multiported register filewith bypass circuitry; and

FIG. 7 is a schematic diagram of the pairing logic utilized in anembodiment of the invention;

FIG. 8 is a block diagram of the memory map of a microstore utilized inan embodiment of the invention;

FIG. 9 is a flow chart of an embodiment of the exception handlingprocedure of the present invention;

FIG. 10 is a flow chart of an embodiment of the unpaired restartprocedure of the present invention;

FIGS. 11A-11J are detailed schematic diagrams illustrating the pipelinestages for exception and branch processing procedures of the presentinvention;

FIG. 11K is a block diagram of exception handling control system.

FIG. 12 is a flow chart of an embodiment of the branching procedure ofthe present invention; and

FIG. 13 is a flow chart of an embodiment of the procedure for handling abranch misprediction.

FIG. 14 is a block diagram of a branch prediction mechanism controlsystem.

DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS

A preferred embodiment executes a target instruction set utilized by anexisting processor not designed for issuing more than one instructionper cycle. Thus, the embodiment is downwardly compatible with theexisting system and may operate programs written for the system.However, as will be demonstrated below, the ability of the presentsystem to concurrently process families of instructions dramaticallyincreases throughput.

A preferred embodiment is a microprogrammed machine where the controlsignals for implementing each object code, or macro, instruction areprovided by a microcode routine unique to the instruction.

A subset of pair candidate (PC) instructions from the target instructionset is selected and special microcode routines for concurrentlyexecuting families of two PCs are stored in the control store. Theselection of which instructions are included in the subset of PCsdepends on various factors including the frequency of the occurrence ofthe instructions in application programs, the difficulty of concurrentexecution of the instructions, and the resources required toconcurrently execute the instructions. These special routines aredependent on special resources, to be described below, in the processor.

However, even for families consisting of only PCs. concurrent executionis not possible if resource conflicts occur. Accordingly, the systemcancels concurrent execution in these instances. The execution unit isconfigured so that such instances occur infrequently and do notsignificantly reduce throughput.

The present system is object code compatible with non-pairing processorsthat execute the target instruction set. This requires that an objectcode program comprising an ordered sequence of object code instructionsthat is executed by the non-pairing machine must also be executed by thepairing machine without any modification to the program.

Thus, in the present system, ordered pairs of instructions occurring inthe program are issued concurrently if predetermined conditions aresatisfied. In a preferred embodiment the occurrence of these conditionsare indicated by status bits generated when the instructions aredecoded.

Referring now to the drawings, where like reference numerals identifyidentical or corresponding parts throughout the several views, FIG. 1 isa high-level block diagram of a preferred embodiment.

In FIG. 1, a fetch unit (FU) 10 is coupled to an instruction cache (IC)12. The FU 10 includes address calculation hardware controlled by anaddress state machine that increments addresses during normal sequentialoperation and calculates branch target (BRANCH-TARG) addresses forconditional branch and jump instructions. The output of the IC 12 iscoupled to instruction queue registers (IQR) 14 and 16. The IQRs 14 and16 and first and second rank 0 pipeline registers (ROS and ROF) 18 and20 are connected in series to form an instruction queue 21. The outputsof ROS and ROF 18 and 20 are coupled, respectively, to the inputs offirst and second rank l registers and to the inputs of a second decodeunit and a first decode unit (DCS and DCF) 22 and 22. The output of thetwo decode units 22 and 24 are connected to the data inputs of a pairinglogic unit (PLU) 26 by first and second decode output (DCO) buses 28 and30. Status bits on these buses are connected to control inputs of thePLU 26 by first and second status buses 32 and 34. The PLU 26 includes adata output coupled to an execution unit (EU) 36 by a merged decode bus(MDB) 38, an FU control output coupled to the FU 10 by a fetch unitcontrol (FUC) bus 40, and a control pipeline unit (PUC) output coupledto the pipeline unit (PU) 25 by a pipeline unit control (PUC) bus 42.The EU 36 also assert the below described FIssue signal.

The operation of the system of FIG. 1 will now be described. The firstand second instructions in the family of instructions are stored in ROFand ROS 20 and 18, respectively. These instructions are decoded at therespective decode units 22 and 24 and the decode results are output onthe respective DCO buses 28 and 30. The first decode result includes afirst entry point field (EPT-F) and a first set of status bits and thesecond decode result includes a second entry point field (EPT-S) and asecond set of status bits. The status bits in each decode resultindicate whether the respective instruction is a PC and what resourcesare required to execute the instruction. The status information fromboth decode results is routed to the PLU control ports on the statusbuses 32 and 34.

A first status bit is designated PC and indicates whether theinstruction is a pair candidate. A second status bit is designatedEPTIssue and indicates whether the macro instruction requires only asingle clock or requires multiple clocks. If multiple clocks arereguired, then the following instruction may be issued during the nextclock. If only a single clock is required, then the data in ROF and ROS20 and 18 doesn't change until an FU issue occurs. This signal isreceived by the FU 10 to restart prefetching. Other status bits indicatewhether the instruction requires the ALU or memory addressing logic toexecute.

The output of the PLU 26 depends on the status information and will beone of three possibilities. First, if the first instruction is not a PCthe decode result of the first instruction is output on the MDB 38 toaccess the microcode routine for singly executing the first instruction.Additionally, the signals issued on the FUC line 40 and the PUC line 42cause a next single instruction to be fetched from the IC 12 and onlythe first instruction (stored in ROF 20) to be issued to the next stageof the PU 25. Thus, the concurrent issuing capability of the processoris not used.

Secondly, if both the first and second instructions are PCs and arepairable, i.e., no resource conflicts exist, the decode results of thefirst and second instructions are merged and output on the MDB 38. Themerge decode results access microcode for executing the first and secondinstructions as a pair. Additionally, the signals issued on the FUC line40 and the PUC line 42 cause the next two instructions in the program tobe fetched from the IC 12 and the pair of instructions stored in theRank 0 registers 18 and 20 to be issued to the next stage of PU 25.

Third, if the first instruction is a PC, but the first and secondinstructions are not pairable, e.g., because of a resource conflict, asubfield of the decode result of the first instruction is output on theMDB 38 to access a microcode routine for singly executing the firstinstruction. Additionally, the signals issued on the FUC line 40 and thePUC line 42 cause a next single instruction to be fetched from the IC 12and only the first instruction to be issued from the ROF register 20 tothe next stage of the PU 25. Thus, the concurrent issuing capability ofthe processor is not used.

The operation of the system is best understood by considering concreteexamples. These examples are for a processor that utilizes a stack asthe data source and data sink for ALU operations. Data is transferredbetween memory and the stack by load and store operations. The stackincludes eight physical registers (R0-R7) and a register pointer (RP)which points to the physical register logically assigned to the top ofthe stack. The stack registers are given logic designations A-H, definedby the value of RP, with the register at the top of the stack designatedA. In this type of processor, data dependencies are characterized bystack register conflicts. Another type of dependency is an RP conflict.Instructions generally increment or decrement RP. Thus, a family ofinstructions may have conflicting requirements for the change of RP.

FIGS. 2 and 3 are schematic diagrams depicting the stack configurationsresulting during the execution of a family of two instructions in astandard manner and listing a routine for concurrently executing theinstructions according to the present invention.

Referring to FIG. 2, the stack configurations for the sequential singleexecution of an LDI-LOAD family of two instructions are depicted. Bothof these instructions write data to the H register defined relative tothe RP. During the execution of LDI, immediate data is written to H (R0)and RP is incremented to change H to R1. Then, during the execution ofLOAD, cache data is written to H and RP is incremented again to change Hto R2.

In terms of a standard three stage pipeline depicted in FIG. 4, each ofthese instructions writes data to the H register and increments RPduring the R3 pipeline stage. Thus, concurrent execution would not bepossible without special resources and techniques to obviate the effectsof these register and RP conflicts.

The concurrent execution of the pair is described in terms of therelatively deep six stage pipeline utilized in the preferred embodiment,depicted in FIG. 5. To concurrently execute the pair, the data cacheaddress for the load instruction is generated during Rank 2, theoperands are fetched, cache data is written to C (R1) and immediate datais written to H (R0) during Rank 3, and RP is increased by 2 to defineR1 as A and R2 as H during Rank 4. Thus, the microcode and resources ofthe present invention allow concurrent issuance and execution of thepair of instructions.

Referring to FIG. 3, the stack configurations for the sequential singleexecution of an LDD-DADD family of two instructions are depicted.Referring again to the three stage pipeline of FIG. 4, during executionof LDD, RP is incremented to define A as R2, the high field of OP-2 datais written to A (R2), and the low field of OP-2 data is written to H(R3) during Rank 2. Finally, RP is incremented again to define A as R3during Rank 3. Then, during the execution of DADD, the data in C (R1)and in A (R3) are summed and written to C (R1) and the data in D (R0)and B (R2) are summed and written to D (R0) during Rank 2 and RP isdecremented by 2 during rank 3.

In terms of the three stage pipeline of FIG. 4, if the pair wereexecuted concurrently the writing of data and summation of data wouldoccur during rank 3 thereby causing an unresolvable data conflict. Afurther conflict would occur during rank 3 because of conflictingrequirements for changing RP.

Referring to the six stage pipeline of FIG. 5, to concurrently executethe pair, OP-2 data is read from the data cache during Rank 3, summedwith the contents of registers A (R1) and B (R0) during Rank 4, and thesum written to A (R1) and B (R0) as well as the original OP-2 datawritten to H (R2) and G (R3) during Rank 5. Thus, no unresolvableregister or RP conflicts occur.

From the above it is clear that concurrent execution requires access todata before it is written to registers in the stack. FIG. 6 depicts aregister configuration facilitating the required access. In FIG. 6 aregister file 60 includes four write ports and four read ports to allowconcurrent transfer of double words. Additionally bypass circuitry 62,bypass buses 64, wide muxes and cross connections 65 between cache data65a, immediate data 65b, and the ALU input buses 65c and SBus 65d allowdirect access to data prior to its being written to the register file60. Thus, the deep pipeline and multiported register file 60 allowmicrocode to execute many combinations of instructions as families.

For example, during the execution of the LDD-DADD pair illustrated inFIG. 3, the cache data is transferred directly, during Rank 3, from thedata cache 66 to the CDHi 67a and CDLo 67b registers prior to beingwritten to the register file while OP-1 H is transferred from RegA toKHReg 67c and OP-1 L is transferred from RegB to KLReg 67d. The sum oftransferred data is calculated by the ALU 68 during Rank 4 and writtento RegA and Reg B during Rank 5. Additionally, the data in CDHi 67a andCDLo 67b is written to RegH and RegG during Rank 5.

For example, a family including a load and load immediate instructioncan be issued during one clock and processed. Similarly, a familyincluding a load and an add instruction can be issued during one clockand processed.

FIG. 7 is a detailed block diagram illustrating the architecture of anembodiment of the invention. The decode units are entry point tables(EPTs) 22 and 24 that respond to the instructions in ROF and ROS 20 and18 to generate first and second entry points EPF and EPS.

The output of the EPTs 22 and 24 are coupled, respectively, to the firstand second DCO buses 28 and 30. The first entry point EPF bit fieldF<0:15> is transferred from EPTF 22 to the first DCO bus 28 and thesecond entry point EPS bit field S<4:15> is transferred from EPTS 24 tothe second DCO bus 30. The bit field F<1,2,14,15> is transferred to thePairing Logic 72 by the first status bus 32 and the bit field S<5,6,7,8>is transferred by the second status bus 34.

The bit field F<9:15> is transferred to the 0 input of a MUX/LOGIC UNIT(MLU) 74 by an FLSB bus 76 and the bit field S<9:15> is transferred tothe 1 input of the MLU 74 by an SLSB bus 78.

The bit field F<2:8> is transmitted on an MMSB bus 80 and the output ofthe MLU 74 is transferred to an MLSB bus 82. The MMSB and MLSB buses 80and 82 are merged to form MSB and LSB sections of the merged EPT (MEPT)bus 38. The MEPT in used to access microcode from a microstore 39.

The Pairing Logic generates PC and EPTIssue signals, transferred on FUCbus 40, that direct the pipeline to issue an instruction pair or asingle instruction. Additionally, a NonPaired PC (NPPC) signal istransmitted on an PCNP line 84 coupled to the 09 input of the MLU 74 andthe bit F<2> is transmitted on a mux control line 86 to the controlinput of the MLU 74.

FIG. 8 is a memory map of the microstore 39 addressed by MEPT<2:15>. TheMSB field of the MEPT is always equal to F<2:8> where F<2> is the MSB.The LSB field of the MEPT is equal to the output of MLU 74 and dependson the signals on the NPPC and mux control lines 84 and 86. The MSB,F<2>, of all PCs has a value of 1 and for all non-PCs has a value of 0.

For a first instruction that is not a pair candidate the MSB, F<2>, is 0and the microcode address (MEPT) is located in the lower half 90 of theaddress space 92. For a first instruction that is a pair candidate theMSB, F<2>, is 1 and the microcode address (MEPT) is the upper half 94 ofthe address space.

The operation of the system depicted in FIG. 7 to generate the MEPT forthe cases where the first instruction is a not a pair candidate, is apair candidate but is not paired, and is a pair candidate and is pairedwill now be described.

If the first instruction is not a pair candidate then F<2> is 0 and the0 input of the MLU 74 is coupled to the MLSB bus 82 so that the fieldF<9:15> is transmitted on the MLSB bus 82 and the MEPT is:

    MEPT<2:15>=F<2:8>:F<9:15>                                  Eq. 1

so that MEPT is equal to the EPTF field. This address is in the lowerhalf 90 of the address space 92 depicted in FIG. 8. Thus, the MEPT inthis case accesses microcode for executing the first instruction as asingle.

If the first instruction is a pair candidate but is not pairable withthe second instruction then F<2> is 1 and the signal on the NPPC line 84is set. In this case the MLU 74 transfers the field <0000000> to theMLSB bus 82 and the MEPT is:

    MEPT<2:15>=F<2:8>:<0000000>                                Eq. 2

so that the MEPT is equal to the MSB field of the EPTF followed by astring of seven zeros. Thus, the address of the microcode for executinga non-paired pair candidate is located in the upper half 94 of theaddress space 92 depicted in FIG. 8.

If the first instruction is a pair candidate and paired then F<2> is 1and signal on the NPPC line 84 is not set. In this case the MLU 74transfers the field S<9:15> to the MLSB bus 82 and the MEPT is:

    MEPT<2:15>=F<2:8>:S<9:15>                                  Eq. 3

so that the MEPT is equal to the LSB field of the EPTS and the MSB fieldof the EPTF. As depicted in FIG. 8, these addresses follow the addressof the unpaired instruction in the address space.

Subsequent to the issue of an instruction pair, events, such anexception or branch misprediction, may occur that prevent the successfulexecution and retirement of the issued instruction pair. The followingis a description of unique exception handling and branching techniquesfor efficiently coping with the occurrence of these events.

Turning first to exception handling, an exception is caused by acondition internal to the processor that prevents the execution of aninstruction. Examples of such conditions include arithmetic overflowsfor ALU type instructions and page faults for memory reference type ofinstructions.

For each instruction that may encounter an exception, special exceptionhandling procedures that may include software and/or microcode, havebeen developed for singly issued instructions. Generally, the exceptionhandling microcode is much more complicated than the microcode requiredto implement the same instruction in the absence of an exception.

In terms of the six stage pipeline depicted in FIG. 5, the exceptioncondition occurs during rank 4 of the pipeline. Since exceptions occurwhen instructions are paired, one approach to exception handling wouldbe to store special microcode for handling exceptions for each possibleinstruction pair.

However, such an approach has several drawbacks. Since instructionsprior to the one that encounters the exception must be allowed tocomplete, complex fix-up code would be required in some cases to allowstores associated with the first instruction to complete whilepreventing stores associated with the second instruction in the pair.Further, it is possible that more than one exception could beencountered. For example, the pair (LOAD and ADD) might encounter a pagefault exception for the LOAD and an overflow exception for the ADD.Additionally, the number of exception combinations becomes very largeand makes the pair exception procedures extremely difficult to debug.

The present solution utilizes the exception handling procedures alreadyexisting for handling exceptions for singly issued instructions. Themicrocode for implementing the pair detects an exception by testing forthe presence of an exception condition during rank 4 of the pipeline. Aninstruction pair is issued 90 and ranks 1-3 of the pipeline areexecuted--92. This procedure is depicted in the flow chart of FIG. 9. Ifan exception is detected 94 then the unpaired restart procedure iscalled 96 to abort the instruction pair and reissue the firstinstruction in the pair singly. If there is no exception the instructionpair is retired 98.

For the existing exception handling procedures to be utilized, itrequired to present an internal macrostate to the single instructionexception handling procedure consistent with the macrostate that wouldhave occurred if the program were being executed by a non-pairedinstruction machine.

This consistent macrostate is presented by an unpaired restartprocedure, depicted in the flow chart of FIG. 10, that includes the stepof inhibiting 99 the loads and stores that occur during rank 5 if anexception is detected in rank 4. Thus, the contents of the stackregisters are not changed and the internal macrostate is the stateresulting from the execution of the instruction in the program thatimmediately precedes the aborted pair. This macrostate is consistentwith the state that would be presented to the exception handlingprocedures if the program were executed by a non-paired instructionmachine.

In addition to inhibiting the loads and stores of rank 5, the unpairedrestart flushes the pipeline and reissues 99a and 99b the firstinstruction of the pair as a single. If the exception was associatedwith the first instruction, then the singles microcode will againencounter the same exception and can handle the exception as in anon-paired instruction machine.

If the exception was associated with the second instruction, then thefirst instruction will complete without incident and the secondinstruction will again encounter the exception. If the secondinstruction is not paired this time then the singles microcode willhandle the exception. If it is paired then another unpaired restart willoccur.

Although the unpaired restart procedure reduces throughput, the relativeinfrequency of exception occurrence makes this penalty acceptable inview of the tremendous reduction in complexity.

FIGS. 11A through 11G depict the various pipeline stages and proceduresfor handling an exception while a pair of instructions is executing.

In FIG. 11A, the pipeline 25 is divided into instruction and addresssides that include instruction and address queues 21I and 21A andinstruction and address rank register sets 25I and 25A. Additionally, aninstruction mux 90I and an address mux 90A selectively couple theoutputs of the instruction queues IQ2 and IQ3 registers and rank 5registers of the instruction and address sides, respectively, to theaddress calculation hardware of the FU 10. In FIGS. 11B through 11Gbuses and registers that are enabled are indicated by bold lines.

In FIG. 11B, the instruction pair A+B is ready to issue and is outputfrom the rank 0 registers 18I and 20I of the instruction side and theaddresses of A and B from the rank 0 registers 18A and 20A on theaddress side. The bits of the instructions are transferred to the EPTson DCO buses 28 and 30.

FIGS. 11C through 11F depict the progress of the instruction pair fromrank 1 to rank 4. At rank 4 the microcode tests for an exception such asthe setting of an arithmetic overflow bit or a page fault. If noexception is detected the pair continues through rank 5 and is retired.This testing may be implemented by a conditional branch in the microcodethat utilizes an exception status bit as a branch condition bit. Forexample, an exception indicating bit could be the arithmetic overflowbit stored in a condition code register.

FIG. 11G illustrates the unpaired restart procedure. The microcodecontrols the address mux 90A to transfer the address of instruction A tothe address calculation hardware in the fetch unit 10. Additionally, thepair A+B and their addresses are loaded into the rank 1 through 5registers of the instruction and address sides respectively to begin theflush of the pipeline.

In FIG. 11H, the instruction calculating hardware in the fetch unit 10accesses the instruction A from the IC 12 and the microcode controls theIQ muxes to route the instruction to the instruction R0 registers 20Iand the instruction address to address R0 register 20A.

In FIG. 11I, instruction A and its address have been transferred to theinstruction ROF and the address ROF 20I and 20A, respectively.

In FIG. 11J, instruction A has been reissued as a single.

FIG. 11K is a block diagram of a control system for implementing theunpaired restart procedure. Referring to FIG. 11K, the output of thecontrol store is coupled to an MCR3 register 100 which, in addition toMCR4 and MCR5 registers 102 and 104, form a microcode pipeline whichoperates in synchronism with the instruction pipeline 25 to providerequired control signals to execute the instruction families in thepipeline. The rank 4 microcode includes an m-bit field which is coupledto the first input port of an AND gate 106. An exception indication testbit field generated by ALU 108 of the EU 36 is coupled to the input of alatched MUX 110. The control port of MUX 110 is coupled to a controlfield of the rank 5 microcode and the output is coupled to the secondinput port of the AND gate 106. The output of the AND gate 106 iscoupled to the input of a first decoder (DEC1) 112. The outputs of DEC1are the control signals which cause the pipeline to be flushed and theRank 5 write operations to be inhibited in the event that an exceptioncondition is detected.

The operation of the system depicted in FIG. 11K will now be described.The control field of rank 5 microcode causes the MUX 110 to transmit theparticular exception indication test bit to be tested for theinstruction family being executed. If an exception condition hasoccurred then the transmitted test bit is a logical "1", AND gate 106 isopen, and the m-bit Rank 5 microcode field is decoded to generate thecontrol signals for implementing the unpaired restart procedure. If theexception condition has not occurred then the transmitted test bit is alogical "0", the AND gate 106 is closed, and the outputs of the decoderdo not cause the unpaired restart procedure to be implemented.

The procedure for handling branch instructions will now be describedwith reference to the flow charts of FIGS. 12 and 13. As in manypipelined systems, a branch prediction ram (BPR) is included. For eachbranch instruction the state of a branch prediction bit (BPB) in the BPRindicates the value of the branch condition the last time the associatedbranch instruction was executed. It is assumed that the branch conditionbit will again have the same value. Referring to FIG. 12, the BPB istested 113a and if the BPB predicts that the branch will not be takenthen prefetching continues in order of ascending addresses 113b. If thebranch is predicted taken, then prefetching stops while the address ofthe target address is formed. Once this target address is formed,prefetching resumes at the target location 113c.

As described above with reference to FIG. 7, the MEPT is uniquelydetermined by the bits of the first and second instructions in a pairand reflects the order of the instructions, i.e., the MSB field includesbits from the EP of the first instruction and the LSB field includesbits from the EP of the second instruction. This unique MEPT accessesmicrocode that includes an indication of whether the first or secondinstruction is the branch instruction.

The branch condition is evaluated at rank 4. The BPB moves through thepipeline 113d and e as a PipeID bit along with the pair or instructionsand is compared 113f to the branch condition bit (BCB) set by apreviously executed instruction. If the BPB and branch condition bitmatch, then the contents of the pipeline are correct, normal processingcontinues 113g, and the instruction pair is retired. If the BPB and BCBdo not match 113h, then the following instructions in the pipeline areincorrect and branch recovery must occur.

Referring now to FIG. 13, the first step in branch recovery depends onwhether the branch instruction is the first or second instruction in thepair. As described above, the microcode routine is different for the twocases. If the mispredicted branch instruction is the first instructionof the pair, then the rank 5 stores of the second instruction must beinhibited because that instruction is not the instruction that is to beexecuted subsequent to the first instruction. Additionally, allsubsequent instructions are flushed from the pipeline and any updatesrequired for the branch are redone.

If the mispredicted branch instruction is the second instruction of thepair, then the Rank 5 stores associated with the instruction pair arecompleted. The remaining stages of the pipeline and the prefetch queueare flushed as before.

In the case of a branch misprediction, a new address must be formed toresume prefetching at the location of the correct next instruction thefollows the branch instruction in the program.

                  TABLE 1                                                         ______________________________________                                        Branch is    Branch was                                                         First/Second Predicted Taken                                                                         ? Next Address                                       ______________________________________                                        First        Yes         R5PF + 1                                               First No TARG of R5PF                                                         Second Yes R5PS + 1                                                           Second No TARG of R5PS                                                      ______________________________________                                    

Address recalculation is required only when the BPB does not match theBCB. Since the branch prediction was incorrect the instructions in thepipeline following the branch instruction are incorrect. Thus, if theBPB indicates that the branch is taken then the address of theinstruction in the pipeline following the branch instruction isBRANCH-TARG. However, the following instruction address should beBRANCH+1. Similarly, if the BPB indicates that the branch is not takenthen the address of the instruction in the pipeline following the branchinstruction is BRANCH+1. However, the following instruction addressshould be BRANCH-TARG.

Referring to Table 1, in the first row the microcode indicates that thefirst instruction in the pair, now resident in register R5I-F of thepipeline, is the branch instruction. Since the BPB mispredicted that thebranch would be taken. the address of the next instruction should beBRANCH+1 instead of BRANCH-TARG.

Referring back to FIG. 11A, the address of the branch instruction, nowresident in register R5P-F, is transferred to the address calculationhardware of the FU 10 via the address side MUX 90A. This addressincremented to form the address, BRANCH+1, of the next instruction to befetched.

In the second-row of table 1 the microcode indicates that the firstinstruction is the branch instruction. Since the BPB mispredicted thatthe branch would not be taken, the address of the next instructionshould be BRANCH-TARG instead of BRANCH+1.

Referring to FIG. 11A, the branch instruction and its address, nowresident in registers R5I-F and R5P-F, respectively, are routed to theaddress calculation hardware of the FU 10 via the instruction side andaddress side MUXes 90I and 90B. The address calculation hardware thencalculates the address, BRANCH-TARG, of the next instruction to befetched.

FIG. 14 is a block diagram of a control system for implementing thebranch prediction mechanism. The control store 39 and MCR3, MCR4, andMCR5 registers 100, 102, and 104 are coupled as described above withreference to FIG. 11K. Additionally, each rank of the control pipelineincludes a Pipe ID (PID) register 120 which stores certain informationregarding the instruction being executed. A branch prediction RAM (BPR)122 has an output coupled to the PID register 120 so that a branchprediction bit (BPB) is propagated through the pipeline for a branchinstruction A being executed. The BPB stored in the Rank 4 PID register120 is coupled to a first input of a comparator 124 and a branchcondition bit stored in a condition code register 126 or transferredfrom the ALU is coupled to the second input of the comparator 124. Ann-bit field of the Rank 4 microcode is coupled to the first input andthe output of the comparator 124 is coupled to the second input of anAND gate 128 via MUX 127. MUX 127 is controlled by a control field ofthe Rank 4 microcode. The output of the AND gate 128 is coupled to theinput of a decoder (DECA) 130. The outputs of DECA 130 are the controlsignals which cause the branch prediction mechanism to be implemented.

The operation of the system depicted in FIG. 14 will now be describedfor four separate cases. The first two cases relate to conditionalbranch instructions where the BCB is a bit set in the condition coderegister 126 by a previously executed instruction. The two cases aredistinguished by whether the previous instruction was included in apreviously executed family or in the current family that includes thebranch instruction.

The second two cases relate to a conditional branch instruction wherethe BCB is calculated by the ALU using data stored in the register file,for example RegA, by a previously executed instruction. Again the twocases are distinguished by whether the previous instruction is includedin the current family. In the first case, the BCB in the condition coderegister 126 has been set during the execution of a previousinstruction. If the BCB and the BPB from the PID 120 register do notmatch then the branch was mispredicted and the output of the comparator124 opens AND gate 128. The n-bit Rank 4 microcode field is then passedto DECA 130 to generate the control signals required to implement thebranch prediction mechanism. As described above, the n-bit fieldindicates the position of the branch instruction in the family and thusthe output of the decoder will differ depending on this location.

If the BCB and BPB match then the output of the comparator 124 closesAND gate 128 and the control signals for implementing the branchrecovery mechanism are not generated because the contents of thepipeline are correct.

If the BCB is a bit from the condition code register 126 that is beingwritten by an instruction in the current family then the BCB bit must beprovided to the comparator 124 prior to being written to the registerfile. The MUX 127 is controlled to provide the output of the ALUdirectly to the comparator 124 during Rank 4 and then the BCB is writtento the condition code register during Rank 4.

If the BCB is calculated by the ALU and the register data was written byan instruction in a previous family, the register data is transferred tothe ALU and the ALU output is transferred to the comparator 124 via theMUX 127.

If the register data is generated by an instruction in the currentfamily, the data is provided to the ALU, utilizing the hardwaredescribed with reference to FIG. 6, prior to being written to theregister file and the ALU output is transferred to the comparator 124via the MUX 127 during Rank 4. The data is then written to the registerfile during Rank 5.

The invention has been described for a system for concurrently executingfamilies of two instructions, however the principles of the inventionare equally applicable to families of more than two instructions. Thepairing logic would be modified to respond to more than two statusfields and special microcode routines would be written to concurrentlyexecute the family.

Additionally, although a microcoded processor has been described thesystem is applicable to machines using logic arrays to generate controlsignals. Both systems have advantages in certain situations and thechoice is not critical to practicing the invention. Further, a registerconfiguration other than a register stack can be utilized.

The status bits described with reference to FIG. 7 are used by thepairing logic to determine whether to merge the EPs of the family ofinstructions. Alternatively, the EPs could always be merged and theaccessed microcode would control whether the family of instructions isissued concurrently.

Further, the selection of a subset of target instructions that may issueconcurrently is not required. Microcode routines can be provided forevery possible pair of instructions from the target instruction set.

Thus, it is apparent that although the invention has been described withreference to preferred embodiments, substitutions and modification wouldbe obvious to a person of ordinary skill in the art. Accordingly, it isnot intended to limit the invention except as provided by the appendedclaims.

What is claimed is:
 1. A method, performed by a data processor, ofconcurrently processing a family of instructions, with the dataprocessor including a decode stage, having resources for decodingmultiple instructions in a single clock and for generating microcodecorresponding to each decoded instruction and with the data processorincluding a pipeline for concurrently processing multiple instruction,with the data processor having working registers for storing sourceoperand data required to execute instructions and for storing resultoperand data resulting from the execution of instructions, said methodcomprising the steps of:concurrently decoding at least a pair ofinstructions to generate microcode, corresponding to each instruction,for controlling the pipeline to execute said pair of instruction, withthe pair of instructions including a dependent instruction that utilizessource operand data which is result operand data resulting fromexecuting the other instruction in the pair of instructions;concurrently issuing the pair of decoded instructions to said pipeline,with said microcode controlling the pipeline to process the pair ofinstructions; processing said other instruction in the pair to generatesaid result operand data; andbypassing said working registers to providesaid result operand data as source operand data for said dependentinstruction prior to writing said result operand to said workingregisters so that said dependent instruction can be processed prior towriting said result data in said working registers.
 2. The method ofclaim 1 further comprising the step of:concurrently retiring said pairof instructions in a single clock.